{extend name="public/layout"/}
{/block}
{block name="content"}


<div class="row">
    {include file="landing/left"/}

    <div class="col-md-7" style="padding-top: 70px;">

        <div class="" style="margin-top:15px;">
            <!--<iframe name="landingpage" src="https://test.woordee.com/bdl/we4" frameborder="0"  style="width:800px;height:1000px;margin:13px 0 0 15px;"></iframe>-->
        </div>

    </div>
    <div class="col-md-3" style="padding-top: 70px;">

        <div class="" style="margin-top:15px;">
            <table class="table table-hover table-striped">
                <tr class="active">
                    <td colspan="2">操作</td>
                </tr>

                {volist name="TplContentList" id="vc"}
                <tr>
                    <td>{$vc['module_name']}</td>
                    <td>
                        <button type="button" class="btn btn-success btn-xs TplContEdit" data-title="{$vc['module_name']}" data-houseid="{$vc['house_id']}" data-id="{$vc['id']}">编辑</button>
                        <button type="button" class="btn btn-danger btn-xs">删除</button>
                    </td>
                </tr>
                {/volist}
            </table>
        </div>

    </div>
</div>

{/block}

{block name="script"}
<script>
    $(function () {
        $(".model_click").click(function () {
            var id = $(this).data("id");
            layer.confirm('是否添加此模板到页面？', {
                btn: ['确定','取消'] //按钮
            }, function(){
                $.post("{:url('landing/addModuleToView')}",{id:id},function(data){
                    if(data.code ==1){
                        layer.msg(data.msg, {icon: 1,end:function () {
                            window.location.href = window.location.href;
                        }});

                    }else{
                        layer.msg(data.msg, {icon: 5});
                    }
                });

            }, function(){
                layer.closeAll();
            });
        });


        $(".TplContEdit").click(function () {
            var id = $(this).data("id");
            var houseId = $(this).data("houseid");
            var title = $(this).data("title");
            layer.open({
                type: 2,
                title: title,
                shadeClose: true,
                shade: 0.8,
                area: ['75%', '90%'],
                content: "/index/landing/edittplcont.html?id="+id+"&houseId="+houseId //iframe的url
            });
        })
    })
</script>
{/block}


